home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
edit
/
me_cd25.zip
/
MUTT2.ZIP
/
ME2.MUT
< prev
next >
Wrap
Lisp/Scheme
|
1992-11-09
|
6KB
|
193 lines
;; me2.mut - The ME2 initialization file
;; To compile this file: "mc2 -tme2 me2"
;; C Durland Public Domain
;; what(1) string:
"@(#)me2.mut (The part of ME2 written in Mutt) v1.5 8/22/92"
(include me2.h)
(defun
center-cursor { (arg-prefix 0)(reposition-window) }
CR->CR&indent
{
(bind-local-key "newline-and-indent" "^M")
(msg "CR mapped to newline-and-indent")
}
CR->CR { (bind-local-key "newline" "C-M") (msg "CR mapped to newline") }
cut-the-line { (beginning-of-line)(arg-prefix 1)(cut-line) }
insert-line { (beginning-of-line)(open-line) }
mark-and-end { (set-mark)(end-of-buffer) }
mark-and-home { (set-mark)(beginning-of-buffer) }
delete-current-window
{ (if (not (free-window -1)) (msg "Could not delete window")) }
describe-key ;; what is a key bound to
{
(string key bind)
(key (ask "Key: "))
(if (== "" (bind (key-bound-to key)))(msg key " is not bound.")
(msg key " is bound to " bind))
}
rename-buffer
{
(if (not (file-name -1 (complete CC_FNAME "New file name for buffer: ")))
(msg "Could not rename buffer."))
}
not-modified { (buffer-modified -1 FALSE) }
Goto-line
{
(goto-line
(if (arg-flag) (arg-prefix) (convert-to NUMBER (ask "Goto line: "))))
}
use-existing-buffer
{
(arg-prefix 1)
(switch-to-buffer (complete CC_BUF "Use existing buffer: "))
}
)
(defun
shell-region
{
(int bag-id)
(bag-id (create-bag))
(append-to-bag bag-id APPEND-REGION)
(shell-command (bag-to-string bag-id))
(free-bag)
(msg "[Return to resume editing]")(get-key)
}
)
(const RECTANGLE-BAG 0)
(defun ;; rectangle commands
copy-rectangle { (append-to-bag RECTANGLE-BAG APPEND-RECTANGLE) }
cut-rectangle
{ (append-to-bag RECTANGLE-BAG APPEND-RECTANGLE) (erase-rectangle TRUE) }
delete-rectangle { (erase-rectangle TRUE) }
clear-rectangle { (erase-rectangle FALSE) }
)
;; Code superseded by register.mut
;(int paste-bag-id)
;(defun ;; my paste buffer
; MAIN { (paste-bag-id (create-bag TRUE)) }
; yank-paste-buffer { (insert-bag paste-bag-id) }
; fill-paste-buffer
; { (clear-bag paste-bag-id)(append-to-bag paste-bag-id APPEND-REGION) }
;)
(defun insert-file-name { (insert-text (complete CC_FNAME "file name: ")) })
(include modeline.mut)
(include hook.mut)
(include require.mut)
(include nextfile.mut) ;; read next file from command line
(include sysvar.mut) ;; allow user to view or modify system vars
(include bstats.mut) ;; buffer stats
(include alamode.mut) ;; set modes
(include pmatch.mut) ;; paren matching
(include indent.mut) ;; shift a region right or left
(include markring.mut) ;; a ring of marks
(include hidebuf.mut) ;;
(include register.mut) ;; GNU's register stuff
(include case.mut) ;;
(include delbuf.mut) ;; buffer deletion
(include isearch.mut) ;; incremental search
(include search.mut)
(include twiddle.mut) ;; transpose characters
(include undo.mut) ;; undo support
(include window.mut)
(include qr.mut) ;; query replace
(include popup.mut) ;; used by query replace
(include filter.mut) ;; filter region
(include wspace.mut)
(include autoload.mut)
(defun
adjust-lines { (autoload "adjust-lines" "adjust" (push-args 0)) }
calculator { (autoload "calculator" "calc") }
c-mode { (autoload "c-mode" "cmode") }
mutt-mode { (autoload "mutt-mode" "muttmode") }
text-mode { (autoload "text-mode" "textmode") }
pu { (autoload "pu" "dir" (push-args 0)) }
cd { (autoload "cd" "dir" (push-args 0)) }
pwd { (autoload "pwd" "dir") }
edit-picture { (autoload "edit-picture" "picture") }
mail-mode { (autoload "mail-mode" "mailmode") }
buffer-nomunge { (autoload "buffer-nomunge" "nomunge") }
compile { (autoload "compile" "compile" (push-args 0)) }
grep { (autoload "grep" "compile") }
findit { (autoload "findit" "findit") }
spell-buffer { (autoload "spell-buffer" "spell") }
spell-region { (autoload "spell-region" "spell") }
spell-word { (autoload "spell-word" "spell") }
)
(defun MAIN ;; and now the init time code
{
(bind-to-key "delete-whitespace" "F-1") ;; F1
(bind-to-key "next-buffer" "F-2") ;; F2
(bind-to-key "cut-the-line" "F-5") ;; F5
(bind-to-key "p-match" "F-6") ;; F6 in pmatch.mut
(bind-to-key "CR->CR&indent" "F-7") ;; F7
(bind-to-key "CR->CR" "F-8") ;; F8
(bind-to-key "set-the-mark" "F-0") ;; F10
(bind-to-key "cut-the-line" "F-L") ;; delete line key on HP terminals
(bind-to-key "center-cursor" "F-G") ;; insert key
(bind-to-key "mark-and-end" "F-B") ;; end key
(bind-to-key "mark-and-home" "F-A") ;; home key
(bind-to-key "twiddle-left-of-dot" "C-t") ;; in twiddle.mut
(bind-to-key "next-file" "C-xf") ;; in nextfile.mut
(bind-to-key "query-replace" "M-q")
(bind-to-key "query-replace" "M-%")
(bind-to-key "re-query-replace" "M-C-q")
(bind-to-key "Goto-line" "M-g")
(bind-to-key "delete-current-window" "C-x0")
(bind-to-key "list-buffers" "C-xC-b") ;; in bstats.mut
(bind-to-key "show-buffer-stats" "C-x=") ;; in bstats.mut
(bind-to-key "use-existing-buffer" "C-xC-o")
(bind-to-key "spell-word" "M-$") ;; in spell.mut
(arg-prefix 1)(load "osstuff") ;; load os specific ME extensions
(arg-prefix 1)(load "./mext") ;; load directory local ME extensions
(arg-prefix 1)(load "myme") ;; load your personal ME extensions
(if (not (command-line-done)) ;; Gotta process the command line myself
{
(if (!= 1 (argc)) ;; there are files on command line
(next-file) ;; edit first file on command line
(version)) ;; stick something in the message line
})
;; Delete the *scratch* buffer, even if it is the only buffer.
;; If it is the only buffer, this will cause (create-buffer-hook) to be
;; called. Since *scratch* was created before this code was loaded,
;; (create-buffer-hook) hadn't been called.
;; Gotta be careful - *scratch* might already be gone if this file is
;; loaded twice.
(if (!= -2 (attached-buffer "*scratch*"))
(free-buffer (attached-buffer "*scratch*")))
})
(bool hoodoo)
(defun command-line-done ;; [(bool it-has-been-processed)]
{
(if (!= 0 (nargs)) (hoodoo (arg 0)))
hoodoo
})